package com.fs.gateway;

import com.fs.gateway.filter.AccessFilter;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;

@EnableZuulProxy
@EnableDiscoveryClient
@SpringBootApplication
@EnableFeignClients
public class FSGatewayApplication implements CommandLineRunner {


    public static void main(String[] args) throws Exception{
        SpringApplication app = new SpringApplication(FSGatewayApplication.class);
        app.run(args);
    }

    //程序首次启动调用
    public void run(String... strings) throws Exception {
        System.out.println("API GateWay Boot Successfully");
    }

    @Bean
    public AccessFilter accessFilter() {
        return new AccessFilter();
    }
}
